close all;
clear all;
clc;

%define grid
Sx=1;  %physical size along x
Sy=1;  %physical size along y
Nx=10; %number of cells along x
Ny=10; %number of cells along x

%define rectangle size
wx=0.2;
wy=0.6

%compute position indices
dx = Sx/Nx;
nx = round(wx/dx);
nx1 = 1+floor((Nx-nx)/2);
nx2 = nx1+nx-1

dy = Sy/Ny;
ny = round(wy/dy);
ny1 = 1+round((Ny-ny)/2);
ny2 = ny1+ny-1

%create A
A = zeros(Nx,Ny);
A(nx1:nx2,ny1:ny2)=1;
A'


